//
//  YCHomeFooterViewButton.m
//  YCSchool
//
//  Created by yanglinxia on 16/4/26.
//  Copyright © 2016年 yanglinxia. All rights reserved.
//

#import "YCHomeFooterViewButton.h"

@implementation YCHomeFooterViewButton

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.backgroundColor = [UIColor yc_colorWithUInt:0x37509a];
        self.layer.cornerRadius = 175 / 4.0;
        self.layer.masksToBounds = YES;
        self.titleLabel.numberOfLines = 0;
        CGRect titleRect = [@"你好" boundingRectWithSize:CGSizeMake(MAXFLOAT, 30) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:self.titleLabel.font} context:nil];
        CGFloat width = titleRect.size.width;
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.equalTo(@(width));
            make.centerX.centerY.equalTo(self);
        }];
    }
    return self;
}



@end
